
#include "GameState/Main/PauseMenu.h"
#include "Engine/Synaptic/Misc.h"

namespace GameState {

namespace Main {

MainEntry::MainEntry(const Misc::Frame & frame, std::string graphicName) :
	MenuEntry(frame, graphicName),
	Visual("gameplay"), Reason("gameplay"),
	entryFg(graphicName, "screen/gameplay", 3),
	menuAnimation(10),
	focused(false) {

	entryFg.setPosition(frame.x, frame.y);
	entryFg.setFrameSize(frame.w, frame.h);
	menuAnimation.setReverse(true);
	menuAnimation.setFrame(0);
}

Engine::Resource::GraphicList MainEntry::display() {
	Engine::Resource::GraphicList gfxList;
	if (!entryHidden) gfxList.push_back(&entryFg);
	return gfxList;
}

void MainEntry::pulse(int delta) {
	entryFg.setFrame(menuAnimation.update(delta), 0);
}

void MainEntry::haveFocus(bool focused) {
	this->focused = focused;
	menuAnimation.setReverse(!focused);
}

MainEntry::~MainEntry(){
}

EntryMainMenu::EntryMainMenu(const Misc::Frame & frame) : MainEntry(frame, "menuMasterMenu")  {
}

EntryQuit::EntryQuit(const Misc::Frame & frame) : MainEntry(frame, "menuQuit")  {
}

EntryRestart::EntryRestart(const Misc::Frame & frame) : MainEntry(frame, "menuRestart")  {
}


} // namespace GameState::Main

} // namespace GameState
